package com.eightsevensix;

import common.ListNode;

/**
 * @author ピカチュウ(皮卡啾)
 * @date 2021/7/11 14:34
 * @Description:876. 链表的中间结点
 */
public class EightSevenSix {

    public ListNode middleNode(ListNode head) {

        ListNode L = head;
        ListNode R = head;

        while (R != null && R.next != null) {
            L = L.next;
            R = R.next.next;
        }
        return L;
    }
}
